package com.itcam.controller;

import com.itcam.dao.TUser;
import com.itcam.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * Author:Cammy.Wu
 * Date:2024-06-16
 * Description:
 */

@RestController
public class UserController {

    @Autowired
    private UserMapper userMapper;

    // 返回json数据
    @GetMapping("/user/{id}")
    public TUser getUser(@PathVariable Long id) {
        TUser user = userMapper.getUserById(id);
        return user;
    }

}
